#pragma once

#include "CDXTexture2D.h"

#ifdef __SWIG__
%include <typemaps.i>
%apply UINT* OUTPUT {UINT* width, UINT* height}; // GetFrameSize
%apply BOOL& OUTPUT {BOOL& bFullscreen};
#endif

class CDXSwapChain : public CDXTexture2D
{
protected:
	IDXGISwapChain* m_pSwapChain;
public: //overwrite CDXResource
	virtual HRESULT ReleaseResources();

private:
	HRESULT _CreateCompitableTexture();
	HRESULT _CopyContentToSwapChain();
public:
	CDXSwapChain(CDXDevice* pDevice);
	virtual ~CDXSwapChain();
	virtual IDXGISwapChain* GetDXGISwapChain();
	virtual HRESULT CreateEx(DXGI_SWAP_CHAIN_DESC * pDesc);
	virtual HRESULT Create(HWND hwnd);
	virtual HRESULT ResizeBuffer(UINT width, UINT height);
	virtual HRESULT ResizeBuffer(UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);


	

	virtual HRESULT GetFrameSize(UINT* width, UINT* height);
	virtual HRESULT Present();
	virtual HRESULT SetFullscreen(BOOL bFullscreen);
	virtual HRESULT GetFullscreen(BOOL& bFullscreen);
	

};